<?php
/*
Engineer:  Alex Arey
Updated: 12/3/2011
Description: View applications related to student.
*/
 ?>

<h5>Your Submitted Applications</h5>
<table>
    <tr>
        <th>Term</th>
        <th>Status</th>
    </tr>
	<?php if($this->applications):?>
		<?php foreach($this->applications as $app): ?>
			<tr align = "center">
				<td>
					<a href="
						<?php echo $this->url(array('controller'=>'applications','action'=>'view','application'=>$app->_appID)); ?>
						"><?php echo $app->_term; ?>
					</a>
				</td>
				<td>
					<?php 
						if(count($app->_suggestedpositions) > 0){
							$echo = "Under Review";
							foreach($app->_suggestedpositions as $pos){
								if($pos['ACCEPTED'] == 'y') $echo = "Accepted";
							}
							echo $echo;
						}else{
							echo "Submitted";
						}
					?>
				</td>
			</tr>
		<?php endforeach ?>
	<?php endif; ?>
    <?php if(!$this->applications):?>
    	<tr>
    	</tr>
    	<tr>
    		<td colspan="2" align = "center">You have no submitted applications.</td>
    	</tr>
	<?php endif; ?>
</table>



